package com.tmeone.erpone.controller;

import com.tmeone.erpone.entity.JsonResult;
import com.tmeone.erpone.entity.LaserAntiFake;
import com.tmeone.erpone.service.IAntifakeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LaserAntiFakeController {

    @Autowired
    private IAntifakeService antifakeService;

    /*
    * 根据激光码得到产品信息，完成防伪工作
    * */
    @GetMapping("/antifake")
    public JsonResult getMassageByLaserCode(@RequestParam("code") String code){
        LaserAntiFake productBylaserCode = antifakeService.getProductBylaserCode(code);
        return new JsonResult(1,productBylaserCode);
    }
}
